//
//  UIButton+URL.m
//  app
//
//  Created by 刘华舟 on 15/5/25.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "UIButton+URL.h"
#import "UIButton+AFNetworking.h"

@implementation UIButton (URL)

- (void)setImageForState:(UIControlState)state
                 withString:(NSString *)url
{
    [self setImageForState:state withURL:[NSURL URLWithString:[url stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] placeholderImage:nil];
}

- (void)setImageForState:(UIControlState)state
                 withString:(NSString *)url
        placeholderImage:(UIImage *)placeholderImage
{
    [self setImageForState:state withURL:[NSURL URLWithString:[url stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] placeholderImage:placeholderImage];
}


@end
